import Book.Booklist;
import Book.Book;
import user.AdeminUser;
import user.NamolUser;
import user.User;

import java.util.Scanner;

/**
 * Created with Interllij IDEA.
 * Descriptiption:
 * User: 王澄慧
 * Date: 2022-04-16
 * Time: 19:21
 */
public class Main {
    public static User logic() {
        System.out.println("请输入你的名字：");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入你的身份：1—》管理员, 0-》普通用户");
        int choice = scanner.nextInt();
       if(choice == 1){
          return new AdeminUser(name);
       }else{
           return new NamolUser(name);
       }
    }

    public static void main(String[] args) {
        Booklist booklist = new Booklist();
        User user=logic();
        while (true){
            int choice = user.mun();
            user.doiPrerations(choice,booklist);
        }

    }
}
